Skip to content

Add extra_headers support to OpenAIModelConfiguration#45687

Draft
jingjingjia-ms wants to merge 2 commits intoAzure:mainfrom
jingjingjia-ms:feature/eval-openai-default-headers
Draft

Add extra_headers support to OpenAIModelConfiguration#45687
jingjingjia-ms wants to merge 2 commits intoAzure:mainfrom
jingjingjia-ms:feature/eval-openai-default-headers

Conversation

@jingjingjia-ms
Copy link

@jingjingjia-ms jingjingjia-ms commented Mar 13, 2026

Summary

Adds an extra_headers field to OpenAIModelConfiguration TypedDict, enabling prompty-based evaluators to send custom HTTP headers on every LLM call. This unblocks integration with OpenAI-compatible endpoints that require custom routing headers.

Changes

  • _model_configurations.py: Add extra_headers: NotRequired[Dict[str, str]] to OpenAIModelConfiguration
  • _common/utils.py: Merge extra_headers from model config into per-call extra_headers in construct_prompty_model_config()

How it works

Customer headers are merged into the extra_headers parameter on chat.completions.create(), which the OpenAI SDK merges after default headers - allowing override of any header including Authorization.

@github-actions github-actions bot added Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Evaluation Issues related to the client library for Azure AI Evaluation labels Mar 13, 2026
@github-actions
Copy link

Thank you for your contribution @jingjingjia-ms! We will review the pull request and get back to you soon.

Add extra_headers field to OpenAIModelConfiguration TypedDict and merge it
into per-call extra_headers in construct_prompty_model_config. This enables
prompty-based evaluators to send custom HTTP headers (e.g., X-ModelType)
required by OpenAI-compatible endpoints that need custom routing headers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jingjingjia-ms jingjingjia-ms force-pushed the feature/eval-openai-default-headers branch from 831dd14 to c0de83f Compare March 16, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Evaluation Issues related to the client library for Azure AI Evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant